package file.day9_20.day06;

public class ThreadDemo02 {
    public static void main(String[] args) {
        //创建一个实现了Runnable接口的实现类
        Runnable r1 = new MyRunnable1();
        Runnable r2 = new MyRunnable2();
        //Thread有对应的构造方法
        Thread t1 = new Thread(r1);
        Thread t2 = new Thread(r2);

        t1.start();
        t2.start();
    }
}
class MyRunnable1 implements Runnable{
    public void run(){
        for (int i = 0; i < 1000; i++) {
            System.out.println("你是谁");
        }

    }
}
class MyRunnable2 implements Runnable{
    public void run(){
        for (int i = 0; i < 1000; i++) {
            System.out.println("画画的baby");
        }

    }
}